package com.indusfo.spc.controller;

import com.indusfo.spc.pojo.ProList;
import com.indusfo.spc.service.ProListService;
import com.indusfo.spc.vo.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @author louk
 * @date 2019/9/11 13:23
 */
@Controller
@RequestMapping("proList")
public class ProListController {

    @Resource
    private ProListService proListService;


    @RequestMapping("/queryProList")
    @ResponseBody
    public JSONObject queryProList(ProList proList){
        return proListService.queryProList(proList);
    }

    @RequestMapping("/queryStationByProList")
    @ResponseBody
    public JSONObject queryStationByProList(ProList proList)
    {
        return proListService.queryStationByProList(proList);
    }
    @RequestMapping("/deleteProList")
    @ResponseBody
    public JSONObject deleteProList(Integer proId, Integer[] staIds, Integer dataState, HttpServletRequest request)
    {
        dataState=2;
        JSONObject jsonObject = proListService.deleteProList(proId, staIds, dataState, request);
        return jsonObject;
    }
    @RequestMapping("/queryStationBydisSta")
    @ResponseBody
    public JSONObject queryStationBydisSta(Integer[] staIds, Integer pagesize, Integer pageindex, Integer proId, Integer workshopId, Integer productionLineId, HttpServletRequest request)
    {
        return proListService.queryStationBydisSta(staIds,pagesize,pageindex,proId, workshopId, productionLineId,request);
    }
    @RequestMapping("/insertSession")
    @ResponseBody
    public JSONObject insertSession(Integer[] staIds, HttpServletRequest request)
    {
        return proListService.insertSession(staIds,request);
    }
}
